﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sahit.iSoilHotel.Domain.Seedwork;
using Sahit.iSoilHotel.Domain.MainBoundedContext.Tavern.Aggregates.PriceAgg;

namespace Sahit.iSoilHotel.Domain.MainBoundedContext.Tavern.Aggregates.RoomAgg
{
    public class Room:Entity
    {
        private ICollection<RoomSetting> roomSettings;

        public string Number { get; set; }
        public virtual RoomType RoomType { get; set; }
        public virtual Guid RoomTypeID { get; set; }
        public virtual RoomStatus Status
        {
            get
            {
                return (RoomStatus)this.StatusID;
            }
            set
            {
                this.StatusID = (int)value;
            }
        }
        public virtual int StatusID { get; set; }
        public virtual ICollection<RoomSetting> RoomSettings 
        {
            get
            {
                return roomSettings ?? (roomSettings = new List<RoomSetting>());
            }
            set
            {
                this.roomSettings = value;
            } 
        }

        public virtual int FloorID { get; set; }
        public virtual Building RoomBuilding { get; set; }
        public virtual Guid BuildingID { get; set; }

        public void Reserve()
        {
            this.Status = RoomStatus.Reserved;
        }

        public void CheckIn()
        {
            this.Status = RoomStatus.CheckIn;
        }

        public void CheckOut()
        {
            this.Status = RoomStatus.Dirty;
        }

        public void Clean()
        {
            this.Status = RoomStatus.Empty;
        }
    }
}
